import request from '@/utils/request'
// 获取组织架构的真实数据 获取部门信息
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 添加子部门
export const addDepartments = data => request.post('/company/department', data)

// 删除部门
export const delDepartment = id => request.delete(`/company/department/${id}`)

// id获取部门信息
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 更新数据
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
